﻿// <copyright file="XamlGeneratorAttribute.cs" company="Snowman Consulting">
//     Copyright (c) 2009 Snowman Consulting. All rights reserved.
// </copyright>

namespace SnowmanConsulting.ProductKeyManager.Xml
{
    using System.Windows;
    using System.Windows.Controls;
    using System.Xml.Linq;

    /// <summary>
    /// Xaml Generator class
    /// </summary>
    internal static partial class XamlGenerator
    {
        /// <summary>
        /// Generates the margin attribute.
        /// </summary>
        /// <param name="margin">The margin.</param>
        /// <returns>Margin XAttribute</returns>
        internal static XAttribute GenerateMarginAttribute(string margin)
        {
            return new XAttribute("Margin", margin);
        }

        /// <summary>
        /// Generates the font weight attribute.
        /// </summary>
        /// <param name="fontWeight">The font weight.</param>
        /// <returns>Font weight XAttribute</returns>
        internal static XAttribute GenerateFontWeightAttribute(FontWeight fontWeight)
        {
            return new XAttribute("FontWeight", fontWeight);
        }

        /// <summary>
        /// Generates the style attribute.
        /// </summary>
        /// <param name="style">The style.</param>
        /// <returns>Style XAttribute</returns>
        internal static XAttribute GenerateStyleAttribute(string style)
        {
            return new XAttribute(XamlType.Style, style);
        }

        /// <summary>
        /// Generates the orientation attribute.
        /// </summary>
        /// <param name="orientation">The orientation.</param>
        /// <returns>Orientation Attribute</returns>
        internal static XAttribute GenerateOrientationAttribute(Orientation orientation)
        {
            return new XAttribute("Orientation", orientation);
        }

        /// <summary>
        /// Generates the scroll bar visiblity attribute.
        /// </summary>
        /// <param name="visibility">The visibility.</param>
        /// <returns>Scrollbar Visibility Attribute</returns>
        internal static XAttribute GenerateScrollBarVisiblityAttribute(ScrollBarVisibility visibility)
        {
            return new XAttribute("VerticalScrollBarVisibility", visibility);
        }

        /// <summary>
        /// Generates the max height attribute.
        /// </summary>
        /// <param name="maxHeight">Height of the max.</param>
        /// <returns>Max Height Attribute</returns>
        internal static XAttribute GenerateMaxHeightAttribute(decimal maxHeight)
        {
            return new XAttribute("MaxHeight", maxHeight);
        }

        /// <summary>
        /// Generates the dock panel dock attribute.
        /// </summary>
        /// <param name="dockLocation">The dock location.</param>
        /// <returns>Dock Panel Dock Attribute</returns>
        internal static XAttribute GenerateDockPanelDockAttribute(Dock dockLocation)
        {
            return new XAttribute("DockPanel.Dock", dockLocation);
        }
    }
}
